<template>
<div>
  <p>标题：</p>
  {{list.title}}
  <br>
 <p> 内容: </p>
  {{list.content}}
  <br>
  <van-button @click="aduit">审核</van-button>

  <van-dialog v-model:show="show" title="标题" show-cancel-button>
    <van-field :label='描述信息' v-model='descipt'/>
    <van-radio-group v-model="is_agree">
      <van-radio name="2">通过</van-radio>
      <van-radio name="1">未通过</van-radio>
    </van-radio-group>
    <van-button @click='submit'>提交</van-button>
  </van-dialog>
</div>
</template>

<script>
import axios from 'axios'
export default {
  name: "examine",
  data(){
    return{
      id:this.$route.query.id,
      list:[],
      is_agree:2,
      descipt:'',
      show:false,
    }
  },
  methods:{
    get_list(){
      axios({url:'http://localhost:8000/examine?id='+this.id,method:'get'}).then(res=>{
        if(res.data.code==200){
          this.list=res.data.list
        }
      })
    },
    aduit(){
      this.show=true
    },
    submit(){
      axios({url:'http://localhost:8000/examineM/',method:'post',data:{'descipt':this.descipt,'is_agree':this.is_agree,'id':this.id}}).then(res=>{
        if(res.data.code==200){
          this.$toast.success('审核成功')
          this.$router.push('getexamine')
        }
      })
    }
  },
  mounted() {
    this.get_list()
  }
}
</script>

<style scoped>

</style>